import request from '@/utils/request'

// 查询购物车信息列表
export function listShoppingCartItem(query) {
  return request({
    url: '/business/shoppingCartItem/list',
    method: 'get',
    params: query
  })
}

// 查询购物车信息详细
export function getShoppingCartItem(id) {
  return request({
    url: '/business/shoppingCartItem/' + id,
    method: 'get'
  })
}

// 新增购物车信息
export function addShoppingCartItem(data) {
  return request({
    url: '/business/shoppingCartItem',
    method: 'post',
    data: data
  })
}

// 修改购物车信息
export function updateShoppingCartItem(data) {
  return request({
    url: '/business/shoppingCartItem',
    method: 'put',
    data: data
  })
}

// 删除购物车信息
export function delShoppingCartItem(id) {
  return request({
    url: '/business/shoppingCartItem/' + id,
    method: 'delete'
  })
}


// 操作店铺信息
export function saveOrder(query) {
  return request({
    url: '/business/order/saveOrder',
    method: 'post',
    params: query
  })
}


// 查询店铺信息列表
export function listMerchantShopInfo() {
  return request({
    url: '/business/admin/merchantShop/myShopList',
    method: 'get',
  })
}


// 查询地址信息列表
export function listMerchantAddressInfo() {
  return request({
    url: '/business/admin/merchantAddress/myTakeAddressList',
    method: 'get',
  })
}


//购物车修改数量
export function updateShoppingCartItemNum(query) {
  return request({
    url: '/business/shoppingCartItem/updateShoppingCartItemNum',
    method: 'post',
    data: query,
  })
}

//计算：商品总额，运费，实付款
// export function getOrderAmountDetail(data) {
//   return request({
//     url: '/business/shoppingCartItem/getOrderAmountDetail',
//     method: 'post',
//     data: data,
//   })
// }
export function getOrderAmountDetail(id) {
  return request({
    url: '/business/shoppingCartItem/getOrderAmountDetail/' + id,
    method: 'get'
  })
}


